home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / c / c2man-2.0pl33.lha / c2man-2.0 / flatten.SH < prev    next >
Encoding:
Text File  |  1995-01-14  |  1.3 KB  |  52 lines

  1. case $CONFIG in
  2. '')
  3.     if test -f config.sh; then TOP=.;
  4.     elif test -f ../config.sh; then TOP=..;
  5.     elif test -f ../../config.sh; then TOP=../..;
  6.     elif test -f ../../../config.sh; then TOP=../../..;
  7.     elif test -f ../../../../config.sh; then TOP=../../../..;
  8.     else
  9.         echo "Can't find config.sh."; exit 1
  10.     fi
  11.     . $TOP/config.sh
  12.     ;;
  13. esac
  14. : This forces SH files to create target in same directory as SH file.
  15. : This is so that make depend always knows where to find SH derivatives.
  16. case "$0" in
  17. */*) cd `expr X$0 : 'X\(.*\)/'` ;;
  18. esac
  19. echo "Extracting flatten.sed (with variable substitutions)"
  20. : This section of the file will have variable substitutions done on it.
  21. : Move anything that needs config subs from !NO!SUBS! section to !GROK!THIS!.
  22. : Protect any dollar signs and backticks that you do not want interpreted
  23. : by putting a backslash in front.  You may delete these comments.
  24. $spitshell >flatten.sed <<!GROK!THIS!
  25. s!\$(privlib)!$privlib!
  26. !GROK!THIS!
  27.  
  28. : In the following dollars and backticks do not need the extra backslash.
  29. $spitshell >>flatten.sed <<'!NO!SUBS!'
  30. /^.so *example.h$/{
  31. r example.h
  32. d
  33. }
  34.  
  35. /^.so *example.inc$/{
  36. r example.inc
  37. d
  38. }
  39.  
  40. /^.so *ctype_ex.h$/{
  41. r ctype_ex.h
  42. d
  43. }
  44.  
  45. /^.so *ctype_ex.inc$/{
  46. r ctype_ex.inc
  47. d
  48. }
  49. !NO!SUBS!
  50. chmod 755 flatten.sed
  51. $eunicefix flatten.sed
  52.